package cn.com.ejiakanghu.dto;

import org.linlinjava.litemall.db.domain.LitemallGoods;

/**
 * @author houzb
 * @Description
 * @create 2021-04-15 19:01
 */
public class HotGoodsInfo {
    /**
     * 商品id
     */
    private int id;
    /**
     * 商品名称
     */
    private String name;
    /**
     * 商品主图URL,图片宽高尺寸比例:320x320
     */
    private String mainImage;
    /**
     * 商品类型
     * 值可能性：
     * lease 	| [string] 	| 租赁商品
     * 	| 默认值
     * sale 	| [string] 	| 售卖商品
     */
    private String type;
    /**
     * 是否显示万人租标签
     * 0 不显示 1显示
     */
    private int isMany;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getMainImage() {
        return mainImage;
    }

    public void setMainImage(String mainImage) {
        this.mainImage = mainImage;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public int getIsMany() {
        return isMany;
    }

    public void setIsMany(int isMany) {
        this.isMany = isMany;
    }

    public HotGoodsInfo getInstance(LitemallGoods goods){
        HotGoodsInfo goodsInfo = new HotGoodsInfo();
        goodsInfo.setId(goods.getId());
        goodsInfo.setMainImage(goods.getPicUrl());
        goodsInfo.setName(goods.getName());
        //TODO 设置是否万人租/买商品标签
        return goodsInfo;
    }
}
